home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / Pyramid / Source / perspect.h < prev    next >
C/C++ Source or Header  |  1993-09-15  |  2KB  |  72 lines

  1. /*    perspect.h - matrix algebra definitions
  2.  *    Copyright (C) 1993 Corona Design, Inc. All rights reserved.
  3.  *
  4.  *    Abstract
  5.  *        Common 3D perspective transformations. Provides an arbitrary
  6.  *        view plane with a center of perspective 1 unit (in VIEW space)
  7.  *        from the view plane.
  8.  *
  9.  *        Reference: Foley & van Dam, Computer Graphics
  10.  *        C callable.
  11.  *
  12.  *    RCS path: 
  13.  *        $Source: /Users/pkron/Projects/voxel/Pyramid/matrix.subproj/RCS/perspect.h,v $
  14.  *    Modified: $Date: 93/09/15 12:34:04 $ by $Author: pkron $
  15.  *    Current State: $State: Exp $ locked by $Locker:  $
  16.  */
  17.  
  18. #ifndef    _PERSPECT_H
  19. #define    _PERSPECT_H
  20.  
  21. #include    "standard.h"
  22.  
  23. typedef    struct _matrix    *MATRIX;
  24. typedef float            POINT[4];
  25.  
  26.                             // allocate an identity matrix
  27. EXTERN_C    MATRIX        allocIdentity();
  28.  
  29.                             // free an allocated matrix
  30. EXTERN_C    void        freeMatrix( MATRIX matrix);
  31.  
  32.                             // map a point in a given transform
  33. EXTERN_C    void        map( MATRIX matrix, POINT *aPoint);
  34.  
  35.                             // orient the view space
  36.                             // normal and up define vectors in world space
  37.                             //     from (0,0,0) to the specified point
  38.                             // normal defines the z-axis of the view space
  39.                             //         (normal to the view plane)
  40.                             // up defines a vector which will project onto
  41.                             //        the positive y-axis of the view plane
  42. EXTERN_C    void        orient( MATRIX matrix, POINT *normal, POINT *up);
  43.  
  44.                             // project a mapped point onto the view
  45.                             // plane
  46. EXTERN_C    void        project( POINT *aPoint);
  47.  
  48.                             // concatenate transform with projection 
  49.                             // into viewplane
  50. EXTERN_C    void        scaleProjection( 
  51.                                 MATRIX transform, 
  52.                                 int width, int height
  53.                                 );
  54.  
  55.                             // translate the origin to a point in VIEW space
  56. EXTERN_C    void        translate(     MATRIX matrix, POINT *to);
  57.  
  58.                             // set the distance from the Center Of Perspective
  59.                             // to the VIEW space origin.
  60. EXTERN_C    void        viewDistance( MATRIX matrix, float distance);
  61.  
  62. #endif    // PERSPECT_H
  63.  
  64. #ifdef    _LOG
  65. /*
  66.  *    $Log:    perspect.h,v $
  67.  * Revision 1.1  93/09/15  12:34:04  pkron
  68.  * Created
  69.  * 
  70.  */
  71. #endif        
  72.